package com.itany.time;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class TaskManager implements ServletContextListener {

    Thread td = new Thread(new OnlineNumbers());

    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        td.start();
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        td.interrupt();
    }
}
